﻿using Digitalmes.Application.Sys.Orgs;

namespace Digitalmes.Application.Sys.Users;

/// <summary>
/// 用户 DTO 对象。
/// </summary>
public sealed class SysUserDto : Dto
{
    /// <summary>
    /// 用户账号
    /// </summary>
    [NotNull]
    public string? UserName { get; set; }

    /// <summary>
    /// 密码
    /// </summary>
    [NotNull]
    public string? Password { get; set; }

    /// <summary>
    /// 昵称
    /// </summary>
    [NotNull]
    public string? Nickname { get; set; }

    /// <summary>
    /// 手机号
    /// </summary>
    public string? Phone { get; set; }

    /// <summary>
    /// 邮件
    /// </summary>
    public string? Email { get; set; }

    /// <summary>
    /// 头像
    /// </summary>
    public string? Avatar { get; set; }

    /// <summary>
    /// 性别
    /// </summary>
    public GenderEnum Gender { get; set; } = GenderEnum.Unknown;

    /// <summary>
    /// 所属的机构 Id
    /// </summary>
    public long? OrgId { get; set; }

    /// <summary>
    /// 所属的机构
    /// </summary>
    public SysOrgDto? Org { get; set; }

    /// <summary>
    /// 简介
    /// </summary>
    public string? Description { get; set; }

    /// <summary>
    /// 启用状态（0->停用，1->启用）
    /// </summary>
    public EnabledStatusEnum Status { get; set; }

    public string? CreatedBy { get; set; }

    public DateTime CreatedTime { get; set; }

    public string? LastModifiedBy { get; set; }

    public DateTime? LastModifiedTime { get; set; }

    /// <summary>
    /// 用户拥有的角色关系集合。
    /// </summary>
    [NotNull]
    public List<SysUserRoleDto> UserRoles { get; set; } = [];
}
